﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class driver : System.Web.UI.UserControl
{
    public string Town;
    public string City;
    public string townNcity;
    public string getCityTownName()
    {
        townNcity = "";
        if (Town == "0" || City == "0")
        {
            Response.Redirect("default.aspx");
        }
        else
        {
            string qry = "SELECT Name FROM [taxi].[dbo].[Town] WHERE TownID='" + Town + "'";
            DataSet ds = DBClass.Default.SelectCommand(qry);
            townNcity += ds.Tables[0].Rows[0]["Name"].ToString().Trim();
            qry = "SELECT Name FROM [taxi].[dbo].[City] WHERE CityID='" + City + "'";
            ds = DBClass.Default.SelectCommand(qry);
            townNcity += " / ";
            townNcity += ds.Tables[0].Rows[0]["Name"].ToString().Trim();
         }
        return townNcity;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string detail = Request.QueryString["Detail"];
        bool dtl = string.IsNullOrEmpty(detail);
        this.pnl_drivers.Visible = dtl;
        this.pnl_driverdetail.Visible = !dtl;
        
    }
}